<!DOCTYPE html>
<html lang="en">

<head>
    <include file="Public/head" />
    <link rel="stylesheet" href="__PUBLIC__/Home/static/css/index.css"/>
    <script type="text/javascript" src="__PUBLIC__/Home/static/js/jquery.qqFace.js"></script>
    <script>
        var domain_url="{:C('LOCAL_DOMAIN')}";
        var login = 0;
        var login_url = "{$login_url}";
        var register_url = "{:U('User/register')}";
        $(function(){
            $('input.denglu').click(function(event) {location.href=login_url});
            $('input.zhuce').click(function(event) {
                location.href = register_url;
            });
        });
        {:C('GLOBAL_BDHM')}
    </script>
</head>

<body>
    <!-- 头部 -->
    <include file="Public/header" />
    <!-- /头部 -->

    <div class="main">
        <div class="main-content">
            <div class="sidebar">
                <div class="personal1">
                    <div class="bg-blue"></div>
                    <img src="__PUBLIC__/Home/static/images/avatar-mr.png" alt="" class="avatar-mr"/>
                    <div class="info-tips">游客，您好</div>
                    <div class="btn-tips">
                        <input type="button" value="登录" class="denglu"/>
                        <input type="button" value="注册" class="zhuce"/>
                    </div>
                </div>
                <div class="recommend">
                    <div class="recommend-title">
                        <div class="title-info">热推视频</div>
                        <div class="change js-fresh-hot">
                            <i class="change-img"></i>
                            <div class="change-span">换一换</div>
                        </div>
                    </div>
                    <include file="Template/hot" />
                </div>
            </div>
            <div class="content-right">
                <include file="Template/trade" />
            </div>
        </div>
    </div>
    <include file="common/footer"/>
</body>
<script type="text/javascript" src="__PUBLIC__/Home/static/js/index.js"></script>
<script type="text/javascript">
    var tradePage = 1;
    var data_url = "{:U('Visitor/index')}";
    $(window).scroll(function () {
        var scrollTop = $(this).scrollTop();
        var scrollHeight = $(document).height();
        var windowHeight = $(this).height();
        if (scrollTop + windowHeight >= scrollHeight - 5 && !fetching) {
            if (!fetching) {
                var url = data_url + '?page='+(++tradePage);
                loadData(url);
            }
        }
    });
    loadData(data_url);
    var height=$(".sidebar").height();
    window.onscroll = function(){
        var t = document.documentElement.scrollTop || document.body.scrollTop;
        if(t>height){
            $(".personal").addClass("fixed");
            $(".my-info").addClass("fixed1");
            $(".personal1").addClass("fixed");
        }else{
            $(".personal").removeClass("fixed");
            $(".my-info").removeClass("fixed1");
            $(".personal1").removeClass("fixed");
        }
    };
</script>
</html>